﻿using Dexter.Domain.Model;
using Dexter.Services;
using Dexter.Web.Mvc.ViewModel.Backoffice.Binders;
using Dexter.Web.Mvc.ViewModel.ViewsData;
using Dexter.Web.Mvc.ViewsData;
using Dexter.Web.Utils;

namespace Dexter.Web.Mvc.ViewModel.Backoffice.ViewsData.AccountController {
	public class AccountChangePasswordViewData : BackOfficeBaseViewData {
		static readonly PasswordBinder emptyPassword;
		PasswordBinder password;

		static AccountChangePasswordViewData ( ) {
			emptyPassword = new PasswordBinder {
				NewPassword = "" ,
				OldPassword = ""
			};
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="AccountChangePasswordViewData"/> class.
		/// </summary>
		/// <param name="webUtils">The web utils.</param>
		/// <param name="configuration">The configuration.</param>
		/// <param name="urlBuilder">The URL builder.</param>
		public AccountChangePasswordViewData ( IWebUtils webUtils , SiteConfiguration configuration , IUrlBuilder urlBuilder ) : base ( webUtils , configuration , urlBuilder ) {}

		public PasswordBinder UserPasswordBinder {
			get { return password; }
			set { password = value ?? emptyPassword; }
		}
	}
}